// TODO read more about controller and refs to specific components

Ext.define('Bible.controller.Search', {
    extend: 'Ext.app.Controller',
    
    config: {
        refs: {
            list: 'biblesearchpanel'
        },
        control: {
            'biblesearchpanel searchfield': {
                change: 'searchChange'
            }
        }
    },

    searchChange: function(field, newValue, oldValue, eOpts){
        //<debug>
        console.debug('biblesearchpanel searchfield change', newValue);
        //</debug>
        this.getList().search({
            //start: 0,
            query: newValue
        })
    }
});